﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace UIWindows.Models
{
    public class DisplayItemsModel : INotifyPropertyChanged
    {
        /// <summary>
        /// 排序
        /// </summary>
        public int Index { get; set; }

        /// <summary>
        /// 设备名称
        /// </summary>
        public string MachineInfoName { get; set; }

        /// <summary>
        /// 数据库绑定名
        /// </summary>
        public string Name { get; set; }

        /// <summary>
        /// 是否展示
        /// </summary>
        public bool IsDisplay { get; set; }

        /// <summary>
        /// 是否导出
        /// </summary>
        public bool IsOutput { get; set; }

        /// <summary>
        /// 列名
        /// </summary>
        public string Description { get; set; }
        /// <summary>
        /// 数据库名称
        /// </summary>
        [PropertyChanged.DoNotNotify]
        public string SqlName { get; set; }
        /// <summary>
        /// 数据类型
        /// </summary>
        public string DataType { get; set; } = "无类型";

        public event PropertyChangedEventHandler PropertyChanged;

        public int CompareTo(DisplayItemsModel p)
        {
            int result = 0;
            if (Index == p.Index) result = 0;
            if (Index > p.Index) result = 1;
            if (Index < p.Index) result = -1;
            return result;
        }
    }
}
